﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DotNet.Business;
public partial class rawMaterialDetail : System.Web.UI.Page
{
    #region 变量
    Tab_RawMaterialBll tab_RawMaterialBll = new Tab_RawMaterialBll();
    Tab_RawMaterialClassBll tab_RawMaterialClassBll = new Tab_RawMaterialClassBll();
    /// <summary>
    /// 材料ID
    /// </summary>
    int _id = 0;
    /// <summary>
    /// 材料名称
    /// </summary>
    public string _rawMaterialName = "";
    /// <summary>
    /// 材料类别名称
    /// </summary>
    public string _rawMaterialClassName = "";
    /// <summary>
    /// 材料类别ID
    /// </summary>
    public int _rawMaterialClassID=0;
    /// <summary>
    /// 材料图片地址
    /// </summary>
    public string _imgUrl = "";
    /// <summary>
    /// 材料内容
    /// </summary>
    public string _info = "";
    #endregion

    #region 加载页面 
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["id"]!=null)
            {
                this._id = Convert.ToInt32(Request.QueryString["id"]);
                //绑定材料详细
                this.bindRawMaterial();
            }
        }
    }
    #endregion

    #region 绑定材料详细
    /// <summary>
    /// 绑定材料详细
    /// </summary>
    private void bindRawMaterial() 
    {
        Tab_RawMaterial tab_RawMaterial = new Tab_RawMaterial();
        tab_RawMaterial =tab_RawMaterialBll.GetModel(this._id);
        this._id =tab_RawMaterial.rawMaterialID;
        this._rawMaterialName = tab_RawMaterial.rawMaterialName;
        this._imgUrl =tab_RawMaterial.rawMaterialImgUrl;
        this._rawMaterialClassID = tab_RawMaterial.rawMaterialClassID;
        this._info = tab_RawMaterial.rawMaterialInfo;
        Tab_RawMaterialClass tab_RawMaterialClass = new Tab_RawMaterialClass();
        tab_RawMaterialClass = tab_RawMaterialClassBll.GetModel(this._rawMaterialClassID);
        this._rawMaterialClassName = tab_RawMaterialClass.rawMaterialClassName;
    }
    #endregion
}
